package com.iampzh.springvue.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import com.iampzh.springvue.entity.User;
import com.iampzh.springvue.mapper.UserMapper;


public class ExcelReadListener extends AnalysisEventListener<User> {
    private UserMapper userMapper;




    public ExcelReadListener(UserMapper userMapper) {
        this.userMapper = userMapper;
    }



    @Override
    public void invoke(User user, AnalysisContext analysisContext) {

           userMapper.insert(user);


    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }


}
